package com.wtwd.device.util;


import com.wtwd.device.constant.Constant;
import com.wtwd.device.constant.UserSourceEnum;
import com.wtwd.device.service.ThirdPartyUserService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author zdl
 * @date 2021/11/12 15:05
 */
@Component
public class ThirdPartyUserFactory {
    @Resource
    private ThirdPartyUserService googleUserServiceImpl;

    /**
     * 选择
     *
     * @param appId
     * @return
     */
    public ThirdPartyUserService getThirdPartyService(UserSourceEnum appId) {
        if (appId == null) return null;
        System.out.println("设置表：" + appId.getTableName());
        Constant.THREAD_LOCAL_TABLE.set(appId.getTableName());
        switch (appId) {
            case WX:
                break;
            case GOOGLE:
                return googleUserServiceImpl;
            default:
                return null;
        }
        return null;
    }
}
